<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2021/10/30
  Time: 15:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>Ajax</title>
      <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>

    <script>
      function a() {
        $.post({
          url:"${pageContext.request.contextPath}/a1",
          data:{"name":$("#username").val()},
          success:function (data) {
            alert(data);
          },
        });
      }
    </script>


  </head>
  <body>


  <input type="text" id="username" onblur="a()">
  </body>
</html>
